<script setup>
import { ref } from 'vue'

defineProps({
  modelValue: {
    type: [Number, String]
  },
  width: {
    type: String
  }
})

const emit = defineEmits(['update:cid'])

const channelList = ref([])

const getChannelList = () => {
  channelList.value = [
    { id: 1, cate_id: 1, cate_name: 'Technology' },
    { id: 2, cate_id: 2, cate_name: 'Health' },
    { id: 3, cate_id: 1, cate_name: 'Lifestyle' }
  ] // Simulated data, replace with actual API call
}

getChannelList()
</script>

<template>
  <el-select
    :modelValue="modelValue"
    @update:modelValue="emit('update:modelValue', $event)"
    :style="{ width }"
    size="large"
  >
    <el-option
      v-for="channel in channelList"
      :label="channel.cate_name"
      :value="channel.id"
      :key="channel.id"
    ></el-option>
  </el-select>
</template>
